Skip to content

Conversation

@KutnerUri
Copy link

there's no way to use the default parser outside of useRouter(). this PR exposes it

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@molefrog
Copy link
Owner

Hi @KutnerUri thanks for your contribution. The default parser is actually just a function from: https://github.com/lukeed/regexparam

Would it make sense to mention it in the README instead of exporting (e.g. "the default value of parser in Router is parse function from regexparam")? Just really want to keep the bundle size lean.

@KutnerUri
Copy link
Author

yes, I ended up using that, but it seems like an implicit dependency, I'd rather use the exact same tooling as wouter.

I was working on a wrapper that adds entry and exist animations, I only needed that to use matchRoute(), which was quite inconvenient.

you can see the original code here:
https://gist.github.com/KutnerUri/777f4d59f8f81f774b0ad5f3837732ac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants